home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / g / gnu_c / pmlsrc23.zoo / pmlsrc / csinh.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-19  |  1.7 KB  |  80 lines

  1. /************************************************************************
  2.  *                                    *
  3.  *                N O T I C E                *
  4.  *                                    *
  5.  *            Copyright Abandoned, 1987, Fred Fish        *
  6.  *                                    *
  7.  *    This previously copyrighted work has been placed into the    *
  8.  *    public domain by the author (Fred Fish) and may be freely used    *
  9.  *    for any purpose, private or commercial.  I would appreciate    *
  10.  *    it, as a courtesy, if this notice is left in all copies and    *
  11.  *    derivative works.  Thank you, and enjoy...            *
  12.  *                                    *
  13.  *    The author makes no warranty of any kind with respect to this    *
  14.  *    product and explicitly disclaims any implied warranties of    *
  15.  *    merchantability or fitness for any particular purpose.        *
  16.  *                                    *
  17.  ************************************************************************
  18.  */
  19.  
  20. /*
  21.  *  FUNCTION
  22.  *
  23.  *    csinh   complex double precision hyperbolic sine
  24.  *
  25.  *  KEY WORDS
  26.  *
  27.  *    csinh
  28.  *    machine independent routines
  29.  *    complex functions
  30.  *    math libraries
  31.  *
  32.  *  DESCRIPTION
  33.  *
  34.  *    Computes double precision complex hyperbolic sine of
  35.  *    a double precision complex argument.
  36.  *
  37.  *  USAGE
  38.  *
  39.  *    COMPLEX csinh (z)
  40.  *    COMPLEX z;
  41.  *
  42.  *  PROGRAMMER
  43.  *
  44.  *    Fred Fish
  45.  *    Tempe, Az 85281
  46.  *    (602) 966-8871
  47.  *
  48.  *  INTERNALS
  49.  *
  50.  *    Computes complex hyperbolic sine of z = x + j y from:
  51.  *
  52.  *        csinh(z) = 0.5 * ( cexp(z) - cexp(-z) )
  53.  *
  54.  */
  55.  
  56. #if defined (__M68881__) && !defined (_M68881)
  57. /*# define _M68881*/
  58. #endif
  59.  
  60. #include <stdio.h>
  61. #include <math.h>
  62. #include "pml.h"
  63.  
  64. COMPLEX csinh (z)
  65. COMPLEX z;
  66. {
  67.     COMPLEX cexpmz;
  68.  
  69.     cexpmz.real = -z.real;
  70.     cexpmz.imag = -z.imag;
  71.     cexpmz = cexp (cexpmz);
  72.     z = cexp (z);
  73.     z.real -= cexpmz.real;
  74.     z.imag -= cexpmz.imag;
  75.     z.real *= 0.5;
  76.     z.imag *= 0.5;
  77.  
  78.     return (z);
  79. }
  80.